import { request } from '@/utils/api'

// PDF 项目
interface PdfItem {
  id: number
  status:number
  stauts_name:string
  name: string
  docmindId: string
}

interface PdfListResponse {
  data: PdfItem[]
}

export async function getPdfList(): Promise<PdfListResponse> {
  try {
    const response = await request<PdfListResponse>({
      url: '/pdf',
      method: 'get'
    });

    if (response.status >= 200 && response.status < 300) {
      return response.data;
    } else {
      throw new Error(`API 请求失败，状态码: ${response.status}`);
    }
  } catch (error) {
    console.error('获取 PDF 列表时出错:', error);
    throw new Error(`获取 PDF 列表失败: ${(error as Error).message}`);
  }
}
